import axios from '@/libs/api.request'


export default {
    appProjectListPage(data) {
        return axios.request({
            url   : '/app/project/page',
            data,
            method: 'post'
        })
    },
    appProjectGetAuthLoginPageUrl(id) {//获取授权连接
        return axios.request({
            url: `/app/project/${id}/get-auth-login-page-url`,
        })
    },
    appProjectStore(data) {//新建
        return axios.request({
            url   : `/app/project`,
            data,
            method: 'post'
        })
    },
    appProjectUpdate(id, data) {//修改
        return axios.request({
            url   : `/app/project/${id}`,
            data,
            method: 'put'
        })
    },
    appProjectDelete(id) {//删除
        return axios.request({
            url   : `/app/project/${id}`,
            method: 'delete'
        })
    },
    appProjectProjectPublishMiniProgram(id) {//获取授权连接
        return axios.request({
            url: `/app/project/${id}/publish-mini-program`,
            method: 'post'
        })
    },
    appProjectTypeGet() {//类型获取
        return axios.request({
            url: `/app/project-type/list`,
        })
    },
    appProjectMiniProgramTemplate(typeId) {//类型下模板获取
        return axios.request({
            url: `/wechat/mini-program-template/app-project-type/${typeId}`,
        })
    },

    appProjectUpdateDomain(id, data) { //修改代码模板的服务器域名及业务域名
        return axios.request({
            url   : `/app/project/${id}/domain`,
            data,
            method: 'put'
        })
    },

    appProjectSynServerDomain(id) { //同步服务器域名配置
        return axios.request({
            url   : `/app/project/${id}/syn-server-domain`,
            method: 'get'
        })
    },

    appProjectSynWebviewDomain(id) { //同步业务域名配置
        return axios.request({
            url   : `/app/project/${id}/syn-webview-domain`,
            method: 'get'
        })
    },

    appProjectExperienceQrCode(id) { //获取体验版二维码
        return axios.request({
            url   : `app/project/${id}/get-experience-qr-code`,
            method: 'get',
            responseType: 'blob',
        })
    },
    getProjectTypeListUri            : '/app/project-type/list',//类型获取uri
    getTemplateListForSearchFilterUri: '/wechat/mini-program-template/get-template-list-for-search-filter',//获取搜索过滤魔板列表

    appProjectUpdateAuditItemList(id, data) { //修改审核项列表
        return axios.request({
            url   : '/app/project/' + id +'/audit-item-list',
            data,
            method: 'put'
        })
    },
    revertCodeRelease(id) {//回退小程序版本
        return axios.request({
            url   : `/app/project/${id}/revert-code-release`,
            method: 'post'
        })
    },
    getLatestAuditStatus(id) {//查询最新一次提交的审核状态
        return axios.request({
            url: `/app/project/${id}/get-latest-audit-status`,
        })
    },
    codeCommit(id) {//上传小程序代码
        return axios.request({
            url   : `/app/project/${id}/code-commit`,
            method: 'post',
        })
    },
    miniProgramSubmitAudit(id) {//小程序提交审核
        return axios.request({
            url   : `/app/project/${id}/mini-program-submit-audit`,
            method: 'post',
        })
    },
    miniProgramWithdrawAudit(id) {//小程序审核撤回
        return axios.request({
            url   : `/app/project/${id}/mini-program-withdraw-audit`,
            method: 'post',
        })
    },
    miniProgramRelease(id) {//发布已通过审核的小程序
        return axios.request({
            url   : `/app/project/${id}/mini-program-release`,
            method: 'post',
        })
    },
    speedUpAudit(id, auditId) {//加急审核申请
        return axios.request({
            url   : `/app/project/${id}/speed-up-audit/${auditId}`,
            method: 'post',
        })
    },
    getMonthSubmitLimitInfo(id) {//查询服务商的当月提审限额（quota）和加急次数
        return axios.request({
            url   : `/app/project/${id}/get-month-submit-limit-info`,
            method: 'get',
        })
    },
    appSetMiniProgramPrivacy(id) {//配置小程序用户隐私保护指引
      return axios.request({
        url: `/app/project/${id}/set-privacy-info`,
        method: 'post'
      })
    },
    getMiniProgramPrivacy(id) {//查询配置小程序用户隐私保护指引
      return axios.request({
        url   : `/app/project/${id}/get-privacy-info`,
        method: 'get',
      })
    },

}
